//
//  RegisterInformationView.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/23.
//

#import "RegisterInformationView.h"

@implementation RegisterInformationView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self CreateUI];
    }
    return self;
}
-(void)CreateUI{

    UIView *bmbackview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, 410)];
    bmbackview.backgroundColor = [UIColor whiteColor];
    bmbackview.userInteractionEnabled = YES;
    [self addSubview:bmbackview];
    
    
    UIView *bmLine = [[UIView alloc]initWithFrame:CGRectMake(15, 15, 3, 15)];
    bmLine.backgroundColor = rgba(22, 120, 255, 1);
    bmLine.layer.cornerRadius = 2;
    [bmbackview addSubview:bmLine];
    UILabel *bmLab = [[UILabel alloc]initWithFrame:CGRectMake(bmLine.frame.size.width+bmLine.frame.origin.x+5, 15, 70, 15)];
    bmLab.text = @"报名信息";
    bmLab.textColor = [UIColor blackColor];
    bmLab.textAlignment = 0;
    bmLab.font = [UIFont systemFontOfSize:16 weight:bold];
    [bmbackview addSubview:bmLab];

    NSArray *titleArr = @[@"报名时间",@"报考驾校",@"学员性质",@"学员地区",@"身份证号",@"居住证状态",@"身份证照片",@"档案编号"];
    
    for (int  i = 0; i < titleArr.count; i++) {
        
        UIButton *bmBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, bmLab.frame.size.height+bmLab.frame.origin.y+10+i*45, APPwidth, 45)];
        [bmBtn setTitle:titleArr[i] forState:0];
        bmBtn.contentHorizontalAlignment = 1;
        [bmBtn setTitleColor:rgba(51, 51, 51, 1) forState:0];
        bmBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 0);
        bmBtn.titleLabel.font = [UIFont systemFontOfSize:14];
        [bmbackview addSubview:bmBtn];
        
        
        UIView *bmline = [[UIView alloc]initWithFrame:CGRectMake(15, bmBtn.height -1, APPwidth-30, 1)];
        bmline.backgroundColor = rgba(245, 245, 250, 1);
        [bmBtn addSubview:bmline];

        if ( i == 0) {
            _btn1 = bmBtn;
        }else if (i == 1)
        {
            
        }
        
    }
    
    
    UIView *bmbottomline = [[UIView alloc]initWithFrame:CGRectMake(0, bmbackview.height -10, APPwidth, 10)];
    bmbottomline.backgroundColor = rgba(245, 245, 250, 1);
    [bmbackview addSubview:bmbottomline];

    //学时信息
    UIView *bottomView = [[UIView alloc]initWithFrame:CGRectMake(0,bmbottomline.height+bmbottomline.y , APPwidth, 210)];
    bottomView.backgroundColor = [UIColor whiteColor];
    bottomView.userInteractionEnabled = YES;
    [self addSubview:bottomView];
    
    
    UIView *bottomLine = [[UIView alloc]initWithFrame:CGRectMake(15, 15, 3, 15)];
    bottomLine.backgroundColor = rgba(22, 120, 255, 1);
    bottomLine.layer.cornerRadius = 2;
    [bottomView addSubview:bottomLine];
    UILabel *bottomLab = [[UILabel alloc]initWithFrame:CGRectMake(bottomLine.frame.size.width+bottomLine.frame.origin.x+5, 15, 70, 15)];
    bottomLab.text = @"学时信息";
    bottomLab.textColor = [UIColor blackColor];
    bottomLab.textAlignment = 0;
    bottomLab.font = [UIFont systemFontOfSize:16 weight:bold];
    [bottomView addSubview:bottomLab];

    NSArray *fkLabArrs = @[@"科二学时",@"科三学时"];
    NSArray *txtLabArrs = @[@"请输入整数",@"请输入整数"];
    for (int k = 0; k < fkLabArrs.count; k++) {
        UIButton *xsBtn = [[UIButton alloc]initWithFrame: CGRectMake(0, bottomLab.height+bottomLab.y+k+45*k, APPwidth, 45)];
        xsBtn.titleLabel.font = [UIFont systemFontOfSize:14];
        xsBtn.contentHorizontalAlignment = 1;
        xsBtn.userInteractionEnabled = YES;
        [xsBtn setTitleColor:rgba(51, 51, 51, 1) forState:0];
        xsBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 0);
        [xsBtn setTitle:fkLabArrs[k] forState:0];
        [bottomView addSubview:xsBtn];
        
        
        UITextField *fktxtf = [[UITextField alloc]initWithFrame:CGRectMake(APPwidth/2-25, 10, APPwidth/2-30, 25)];
        fktxtf.textColor = rgba(153, 153, 153, 1);
        fktxtf.placeholder = txtLabArrs[k];
        fktxtf.keyboardType = UIKeyboardTypeNumberPad;
        fktxtf.font = [UIFont systemFontOfSize:14];
        fktxtf.textAlignment = 2;
        [xsBtn addSubview:fktxtf];
            
        UILabel *typeLab = [[UILabel alloc]initWithFrame:CGRectMake(APPwidth-50,  10, 30, 25)];
        typeLab.text = @"小时";
        typeLab.textColor = rgba(51, 51, 51, 1);
        typeLab.textAlignment = 2;
        typeLab.font = [UIFont systemFontOfSize:14];
        [xsBtn addSubview:typeLab];
        
        UIView *line = [[UIView alloc]initWithFrame:CGRectMake(15, xsBtn.height-1, APPwidth-30, 1)];
        line.backgroundColor = rgba(245, 245, 250, 1);
        [xsBtn addSubview:line];

        if (k == 1) {
            line.hidden = YES;
        }
    }
    
    UIButton *sureBtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth/2-328/2, bottomView.height-70, 328, 45)];
    [sureBtn setTitle:@"确定" forState:0];
    [sureBtn setBackgroundColor:rgba(22, 120, 255, 1)];
    sureBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    [sureBtn setTitleColor:[UIColor whiteColor] forState:0];
    sureBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    sureBtn.layer.cornerRadius = 45/2;
    [bottomView addSubview:sureBtn];
    
    

}
@end
